<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Math Expression</title>
<script src="http://www.google.com/jsapi" type="text/javascript" ></script>
<script type="text/javascript">
	google.load("jquery", "1.3.2");
</script>
<script src="http://gaeinjail.googlecode.com/svn/trunk/src/static/js/jquery.mathparser.js" type="text/javascript"></script>
<style>
div.testarea {width:500px;}
div.testarea input.exp{width:300px;text-align:right;color:blue;}
div.testarea div.toggle{display:inline; cursor: pointer;padding:0 0; text-align:right;}
</style>
<script type="text/javascript">
$(document).ready(function(){
	$('div > input').mathparser();
	$("div > div.toggle").toggle(
		function(ev){
			$(this).text('Disabled');
			var inp = $($($(this).parent().get(0)).children('input').get(0));
			inp.mathparser({enabled:false}).css('color','red');
		},
		function(ev){
			$(this).text('Enabled');
			var inp = $($($(this).parent().get(0)).children('input').get(0));
			inp.mathparser({enabled:true}).css('color','blue');
		}
	);
});
</script>
</head>
<body>
Enter the Math expression and hit Enter or "="<br/>
<div class="testarea">
	 <input type="text" class="exp" value="(5*4)+(1/2)">
	 <div class="toggle">Enabled</div> 
</div>
<div class="testarea">
	 <input type="text" class="exp" value="(10*5)+(1/2)">
	 <div class="toggle">Enabled</div> 
</div>
</body>
</html>